<?php
class Solicitudes_Form_Cambiarestado extends Form_Base {
	
		
	public function __construct($options = null) {
		parent::__construct($options);
	}
	
	public function init() {
        $array_estado = array();
	    $solicitudes = new Solicitudes_Model_Solicitudes();
        $estados = $solicitudes->getEstados();
        
        foreach ($estados as $value){
            $array_estado[$value["codestado"]] = $value["nombre"];
        }
        
		$array_elements[] = new Zend_Form_Element_Hidden("codproceso");
                
	    $element = new Zend_Form_Element_Radio("codestado");
	    $element->setLabel("Cambiar estado");
	    $element->setRequired(true);
	    $element->addMultiOptions($array_estado);
		$array_elements[] = $element;
		
		$element = new Zend_Form_Element_Textarea('justificacion');
		$element->setLabel('Justificación :');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
		$element->setAttrib("rows",5);
		$element->setAttrib("style","width:99%");
        $array_elements[] = $element;
		
		
		$element = new Zend_Form_Element_Submit ( 'btnSubmit' );
		$element->setValue('Guardar');
		$element->setLabel("Cambiar estado");
		$element->setAttrib("class", "iceCmdBtn");
		$array_elements[] = $element;
		
		$this->addElements ($array_elements);
		$this->loadTableDecorators();
	}
	
}